from os.path import join

from browsertests.tools.browsers_updater import Mozilla, MozillaNightly, ChromeNightly, WebKitNightlyWin

BROWSERS_BASE_DIR = r"C:\slave_browsertests\browsers"
CHECK_INTERVAL = 60 * 60 * 12 # 12h

browsers = []

browsers.append(Mozilla(
    base_dir=join(BROWSERS_BASE_DIR, "firefox2"),
    branch_id="fx-2",
    platform="win",
    version="2.0.0.20",
    url="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2.0.0.20-candidates/build1/unsigned/firefox-2.0.0.20.en-US.win32.zip",
))

browsers.append(Mozilla(
    base_dir=join(BROWSERS_BASE_DIR, "firefox3"),
    branch_id="fx-3",
    platform="win",
    version="3.0.6",
    url="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/3.0.6-candidates/build1/unsigned/firefox-3.0.6.en-US.win32.zip",
))

browsers.append(Mozilla(
    base_dir=join(BROWSERS_BASE_DIR, "firefox31"),
    branch_id="fx-3.1",
    platform="win",
    version="3.1b2",
    url="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/3.1b2-candidates/build2/unsigned/win32/en-US/firefox-3.1b2.zip",
))

browsers.append(MozillaNightly(
    base_dir=join(BROWSERS_BASE_DIR, "firefoxtrunk"),
    branch_id="fx-trunk",
    platform="win",
    url="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-3.2a1pre.en-US.win32.zip",
    check_interval=CHECK_INTERVAL,
))

browsers.append(ChromeNightly(
    base_dir=join(BROWSERS_BASE_DIR, "chrometrunk"),
    branch_id="chrome-trunk",
    platform="win",
    url="http://build.chromium.org/buildbot/continuous/LATEST/chrome-win32.zip",
    version_url="http://build.chromium.org/buildbot/continuous/LATEST/REVISION",
    check_interval=CHECK_INTERVAL,
))

browsers.append(WebKitNightlyWin(
    base_dir=join(BROWSERS_BASE_DIR, "safaritrunk"),
    branch_id="sf-trunk",
    url="http://builds.nightly.webkit.org/files/trunk/win/WebKit-SVN-r%(version)s.zip",
    version_url="http://nightly.webkit.org/builds/trunk/win/rss",
    check_interval=CHECK_INTERVAL,
))
